Complementary Reimagined - Better Than Ocelots patch
====================================================

WHAT THIS IS

This is your own Complementary Reimagined pack with two files changed, so that the red
charge bar on the Better Than Ocelots Generator (and the powered Wireless Transmitter) glows the way a command block's face or a
lit furnace's grate glows under this pack.

Install it exactly like the original: drop the zip in .minecraft/shaderpacks and select it.
It replaces the unpatched copy - do not run both.

WHAT CHANGED (two files, nothing else)

1. shaders/block.properties
   Adds two lines.

   block.10461 lists the Generator's fifteen RUNNING blockstates (charge=1..15,
   paused=false) - the red charge bar.

   block.10462 lists the fifteen PAUSED blockstates (charge=1..15, paused=true) - the
   yellow indicator the block shows while a redstone signal is holding it.

   The empty state (charge=0) is in neither: an empty generator is not "on" in either
   sense, and its front carries the same dark red pixels the fade ends on, so including
   it would make a dead generator glow.

   Running and paused get SEPARATE IDs rather than sharing one. It keeps the yellow test
   off the running fronts (whose copper frame carries plenty of orange) and the red test
   off the paused front, so neither can ever catch the other's artwork.

   Both lines are written as fifteen space-separated entries rather than one entry with a
   comma-separated property list, because that is the form this file already uses for
   cauldron:level and chorus_flower:age.

2. shaders/lib/materials/materialHandling/terrainIPBR.glsl
   Adds a branch for material 10461 inside the leaf that already handles IDs 10460-10463.
   It re-reads the texture at LOD 0 (so mipmap blur cannot smear the bar's colour into the
   casing beside it - the same guard the command block case uses), then raises emission
   only on fragments where green and blue are near zero and red is above 0.22.

   That test isolates the twelve bar pixels exactly. Everything else on the block - copper
   frame, grey casing, orange battery - carries real green and blue. The 0.22 floor is
   there because the art has two pixels of (50,0,0) under the battery that are NOT part of
   the bar and never fade; the bar's darkest stage is (61,0,0) = 0.239 and those are 0.196,
   so 0.22 splits them with about 5/255 of margin either side.

   Emission scales with that pixel's own red, so the glow dims as the battery drains
   instead of sitting at a constant glare.

   The 10462 branch does the same for the paused front's yellow indicator, testing
   r > 0.90 && 0.75 < g < 0.90 && b < 0.06. That indicator occupies exactly the same
   twelve texels the red bar does - it is the same lamp in a different colour - and ten
   of those texels are FFD800 while two are FAD300, so both shades have to pass or the
   bar shows a two-pixel hole. The bounds are set by the ORANGE battery drawn just below
   it: DA8B00 is the nearest excluded colour and it misses the green floor by 52/255.
   Pure red cannot reach this branch either, having no green at all.

   Measured across every Generator texture before shipping: the red test matches exactly
   the 12 bar texels on all fifteen running fronts and 0 texels on the side, back, top and
   bottom; the yellow test matches exactly 12 on the paused front and 0 everywhere else;
   and no texel anywhere satisfies both.

WIRELESS TRANSMITTER (added with mod v413)

3. shaders/block.properties
   block.10463 = better-than-ocelots:wireless_transmitter:powered=true. The unpowered rod is
   not listed, so it never glows.

4. shaders/lib/materials/materialHandling/terrainIPBR.glsl
   A 10463 branch next to the Generator's two, re-reading the texture at LOD 0 like they do.
   It lights three kinds of texel on wireless_transmitter_on.png, by colour:
     crystal  - the amethyst inside the tip (strong red AND strong blue): full glow
     redstone - the pure-red pixels at the base of the pole: full glow
     halo     - the reddened copper row just above the redstone: about a third, as falloff
   Measured on the texture: 12 crystal, 4 redstone and 2 halo texels match; the copper pole,
   the teal sculk frame on the tip's corners and the teal collar match nothing.
   If you repaint the rod, keep the crystal pinkish-purple/cream and the redstone pure red, or
   adjust the tests in that branch.

DARK DEEP WATER (added with mod v447)

The mod makes water block 3 light per block, like Better Than Wolves: deeper than ~5 blocks in
daylight (~2-3 at night) is light level 0. This pack's underwater fog was a fixed blue at any depth,
so deep water still looked lit. Four small edits make it follow the light where your eyes are:

5. shaders/shaders.properties
   Two custom uniforms, btoEyeSkyLight and btoEyeBlockLight (smoothed eyeBrightness, ids 260/261).

6. shaders/lib/uniforms.glsl
   Declares those two uniforms.

7. shaders/lib/common.glsl
   btoWaterLight = max(sky light at the eye, darkened for night and rain like the game does,
   block light at the eye); waterFogColor is multiplied by it (with a gentle curve, plus a little
   for Night Vision). Light 0 = black fog; full light = the original colour.

8. shaders/lib/atmospherics/volumetricLight.glsl
   Underwater light shafts are multiplied by the same factor, so there are no sunbeams in dark water.

9. shaders/lib/lighting/mainLighting.glsl
   With your eyes under water, everything is lit by the light the GAME gives it - sky light minus
   the night/rain darkening (btoSkyDarkM in common.glsl), as vanilla does - instead of this pack's
   moonlit ambient, and the small "cave minimum light" is switched off. So a lake bed at light 0
   is pitch black, like without shaders (Night Vision still works).

10. shaders/lib/materials/specificMaterials/translucents/water.glsl
   Looking INTO water from above: this pack's water is mostly see-through, so the bed showed even
   where it is light 0. The surface now estimates the bed's light (surface sky light, minus 3 per
   block of depth, minus the night/rain darkening; or the surface block light) and turns nearly
   opaque where the bed is dark - you see the lit surface, not the bed, just like vanilla.
   (Needs the default detail quality or higher - Potato/Very Low skip this water code.)


11. shaders/lib/atmospherics/fog/mainFog.glsl (+ common.glsl, volumetricLight.glsl)
   Just under the surface your eyes are in bright water, so a fog lit only by the eye's light
   glowed evenly in front of the pitch-black bed and you could still make it out. The fog (and the
   underwater light shafts) in front of each point is now lit like the water THERE: 3 light per
   block deeper than your eyes (btoWaterLightAt in common.glsl), so looking down into deep water
   fades to black.

12. common.glsl + mainLighting.glsl: vanilla's brightness curve under water
   Even at noon a lake bed at light 3-6 still showed, because this pack turns low light levels
   into far more brightness than vanilla does. With your eyes under water, sky light (and the
   underwater fog/light shafts) now go through vanilla's own curve, light/15 -> l / (4 - 3l):
   light 12 = 0.5, 9 = 0.27, 6 = 0.14, 3 = 0.06, 0 = 0. Dim water is near-black and light 0 is
   black at any time of day, exactly like without shaders. Torch light keeps the pack's curve.

13. mainLighting.glsl: no sun on dark lake beds
   This pack's sunlight and water caustics come from the shadow map, which treats water as
   see-through, so a lake bed at light 0 still got full sun at noon. With your eyes under water
   the sun on each block is now faded by the game's light there (after the vanilla curve):
   light 12+ full sun, 9 about half, 6 a fifth, 3 almost none, 0 none.

14. Night vision lifts all of the above (mod v448)
   Every deep-water darkening edit (9-13 and the fog) is blended out by the `nightVision` uniform:
   with Night Vision, or - via the mod, which sets Iris's nightVision to 1 under water - with Water
   Breathing, Poseidon's Spirit or Conduit Power, you see under water the way this pack normally
   draws it.

IF YOU UPDATE COMPLEMENTARY

These changes will be gone. They are small and self-contained: search block.properties and
terrainIPBR.glsl for "10461", "10462" and "10463", and the other files for "Better Than Ocelots"
or "bto", and re-apply.
